package cn.com.mengdou.im;


import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpObjectAggregator;
import io.netty.handler.codec.http.HttpServerCodec;

/**
 * 
 * @description:消息通道初始化类   
 * @fileName:IMServerInitializer.java 
 * @createTime:2015年7月23日 下午7:55:48  
 * @author:肖震 
 * @version 1.0.0  
 *
 */
public class IMServerInitializer extends
		ChannelInitializer<SocketChannel> {
	
	
	@Override
    public void initChannel(SocketChannel ch) throws Exception {
		 ChannelPipeline pipeline = ch.pipeline();        
        pipeline.addLast(new HttpServerCodec());
        pipeline.addLast(new HttpObjectAggregator(65536));
        pipeline.addLast("handler", new IMServerHandler());   
        
		System.out.println("imClient:"+ch.remoteAddress() +"连接上");
    }
}
